home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
STRINGS
/
PACKAGE6
/
CONCAT.DOC
< prev
next >
Wrap
Text File
|
1990-07-25
|
2KB
|
49 lines
---------------------------------------------------------------------------
Concatenate
---------------------------------------------------------------------------
declaration: procedure Concatenate ( StringOne,
StringTwo :
TypeString ;
var ResultString :
TypeString ) ;
purpose: Concatenates two strings.
preconditions: StringOne and StringTwo were originally initialized.
ResultString is undefined ( or has a value which will
be deleted in its initialization ).
postconditions: ResultString has been initialized and is the concatenation
of StringOne and StringTwo.
special cases: If the sum of the Lengths of StringOne and StringTwo is
greater than MaxStringLength then the ResultString will
be truncated to MaxStringLength.
example var
FirstName,
LastName,
FullName:
TypeString;
LastKey:
TypeKey;
begin
.
.
.
write ( output, 'Enter first name :' );
ReadLnString ( FirstName, MaxStringLength, LastKey );
FirstName.Length := FirstName.Length + 1;
write ( output, 'Enter last name :' );
ReadLnString ( LastName, MaxStringLength, LastKey );
Concatenate ( FirstName, LastName, FullName );
.
.
.
end
---------------------------------------------------------------------------